From: Bhupinder Thakur Date: Wed, 27 Sep 2017 06:13:28 +0000 (+0530) Subject: xen/arm: vpl011: Add a new console_open_log function in xenconsole X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1247 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=b6cd2afdecf802030606b163c51d265d7febf4de;p=xen.git xen/arm: vpl011: Add a new console_open_log function in xenconsole This patch introduces a console_open_log console_cleanup function. This function opens the console log file. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index ff69e52057..cfd727376c 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -1038,6 +1038,15 @@ static void handle_hv_logs(xenevtchn_handle *xce_handle, bool force) (void)xenevtchn_unmask(xce_handle, port); } +static void console_open_log(struct console *con) +{ + if (console_enabled(con)) { + if (con->log_fd != -1) + close(con->log_fd); + con->log_fd = create_console_log(con); + } +} + static void handle_log_reload(void) { if (log_guest) { @@ -1045,9 +1054,7 @@ static void handle_log_reload(void) for (d = dom_head; d; d = d->next) { struct console *con = &d->console; - if (con->log_fd != -1) - close(con->log_fd); - con->log_fd = create_console_log(con); + console_open_log(con); } }